package com.ruoyi.zk.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zk.mapper.ZkAdmitplanMapper;
import com.ruoyi.zk.domain.ZkAdmitplan;
import com.ruoyi.zk.service.IZkAdmitplanService;
import com.ruoyi.common.core.text.Convert;

/**
 * 招生计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-18
 */
@Service
public class ZkAdmitplanServiceImpl implements IZkAdmitplanService 
{
    @Autowired
    private ZkAdmitplanMapper zkAdmitplanMapper;

    /**
     * 查询招生计划
     * 
     * @param id 招生计划主键
     * @return 招生计划
     */
    @Override
    public ZkAdmitplan selectZkAdmitplanById(Long id)
    {
        return zkAdmitplanMapper.selectZkAdmitplanById(id);
    }

    /**
     * 查询招生计划列表
     * 
     * @param zkAdmitplan 招生计划
     * @return 招生计划
     */
    @Override
    public List<ZkAdmitplan> selectZkAdmitplanList(ZkAdmitplan zkAdmitplan)
    {
        return zkAdmitplanMapper.selectZkAdmitplanList(zkAdmitplan);
    }

    /**
     * 新增招生计划
     * 
     * @param zkAdmitplan 招生计划
     * @return 结果
     */
    @Override
    public int insertZkAdmitplan(ZkAdmitplan zkAdmitplan)
    {
        zkAdmitplan.setCreateTime(DateUtils.getNowDate());
        return zkAdmitplanMapper.insertZkAdmitplan(zkAdmitplan);
    }

    /**
     * 修改招生计划
     * 
     * @param zkAdmitplan 招生计划
     * @return 结果
     */
    @Override
    public int updateZkAdmitplan(ZkAdmitplan zkAdmitplan)
    {
        zkAdmitplan.setUpdateTime(DateUtils.getNowDate());
        return zkAdmitplanMapper.updateZkAdmitplan(zkAdmitplan);
    }

    /**
     * 批量删除招生计划
     * 
     * @param ids 需要删除的招生计划主键
     * @return 结果
     */
    @Override
    public int deleteZkAdmitplanByIds(String ids)
    {
        return zkAdmitplanMapper.deleteZkAdmitplanByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除招生计划信息
     * 
     * @param id 招生计划主键
     * @return 结果
     */
    @Override
    public int deleteZkAdmitplanById(Long id)
    {
        return zkAdmitplanMapper.deleteZkAdmitplanById(id);
    }
}
